package com.surfacing.rcp.client.listeners;

import java.util.ArrayList;

import com.surfacing.rcp.client.modelManager.ModelFactory;
import com.surfacing.rcp.client.modelManager.StatAnforderungManager;
import com.surfacing.rcp.model.common.AbstractMessage;
import com.surfacing.rcp.model.entity.StatAnforderung;

/**
 * This class will be notified uppon staff member changes
 * 
 * @author Michael
 */
public class StatAnforderungListener extends ClientListenerAdapter {
	StatAnforderungManager manager = ModelFactory.getInstance()
			.getStatAnforderungManager();

	@Override
	public void add(AbstractMessage addMessage) {
		manager.add((StatAnforderung) addMessage);
	}

	@Override
	public void update(AbstractMessage updateMessage) {
		manager.update((StatAnforderung) updateMessage);
	}

	@Override
	public void remove(AbstractMessage removeMessage) {
		manager.remove((StatAnforderung) removeMessage);
	}

	@Override
	public void list(ArrayList<AbstractMessage> listMessage) {
		manager.removeAllElements();
		for (AbstractMessage msg : listMessage) {
			StatAnforderung member = (StatAnforderung) msg;
			manager.add(member);
		}
	}
}
